<?php
class makehtml_indexAction extends security_login {
	
	function action(){
		ModuleLimit(__CLASS__);
		set_time_limit(0);
		$miceSession = new session();
		$miceSession->set('makehtml','miceCMS');

		$smarty = new Smarty();
		$smarty->load_filter('pre','micePreCompileIndex');

		//将内容写入至一个静态文件
		$content = $smarty->fetch('index/index.php'); 
		$fp = fopen(MICE_DIR.'index.html', 'w'); 
		fwrite($fp, $content); 
		fclose($fp);
		$miceSession->set('makehtml','');

		MessageBox('生成状态','','成功更新主页HTML：index.html<br><br><a href="'.MICE_URL.'index.html" target="_blank">预览</a>','',0,'',0);
		exit;
	}	
}
?>